package _90ZhuangShiQi;

import _90ZhuangShiQi.impl.Circle;
import _90ZhuangShiQi.impl.Rectangle;
import _90ZhuangShiQi.impl.sub.RedShapeDecorator;

/**
 * @Test: 装饰器模式 测试类
 * @author: ZBoHang
 * @time: 2021/9/9 13:43
 */
class Test {
    public static void main(String[] args) {

        Shape circle = new Circle();

        RedShapeDecorator circleDecorator = new RedShapeDecorator(new Circle());
        RedShapeDecorator rectangleDecorator = new RedShapeDecorator(new Rectangle());

        // RedShapeDecorator circleDecorator = new RedShapeDecorator(new Circle());
        // RedShapeDecorator rectangleDecorator = new RedShapeDecorator(new Rectangle());

        System.out.println("------------------------------------");
        circle.draw();

        System.out.println("************************************");
        circleDecorator.draw();

        System.out.println("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$");
        rectangleDecorator.draw();
    }
}
